package it.hopeless.jee6.interceptor;

import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
import java.io.Serializable;


@SortAction @Interceptor
public class SortInterceptor implements Serializable {

    @AroundInvoke
    public Object authorize(InvocationContext ic) throws Exception {
        System.out.println("MI PREPARO A EFFETTUARE IL SORTING");

        Object result = ic.proceed();

        System.out.println("HO EFFETTUATO IL SORTING ... ADESSO RITORNO " + result);

        return result;
    }
}
